package messages;


import java.io.Serializable;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Groupe RT-A1
 */
/**
 * Classe abstraite
 */
public abstract class Message implements Serializable{
       
    public final static long serialVersionUID = 1234567L;

        private String username;
       
        /**
         * Host du client qui gnre le message
         */
        private String hostName;
       
        /**
         * @param username nom qui va Ãªtre associÃ© au nom d'hÃ´te pour former le username
         * @throws UnknownHostException
         */
        protected Message(String username) throws UnknownHostException {
                this.username = username;
                this.hostName = InetAddress.getLocalHost().getHostName();
        }
       
        /**
         * Retourne l'attribut username
         * @return username
         */
        public String getUsername() {
                return username;
        }
       
        /**
         * Retourn l'attribut du nom de l'hte
         * @return hostName
         */
        public String getHostName() {
                return hostName;
        }
       
}

